//
//  PayViewController.m
//  BaseFrame
//
//  Created by ENERGY on 2018/5/11.
//  Copyright © 2018年 com.mxh. All rights reserved.
//

#import "PayViewController.h"

@interface PayViewController ()
@property (nonatomic, strong)UIImageView * logoImg;
@property (nonatomic, strong)UILabel * payeeTitleLab;//收款方
@property (nonatomic, strong)UILabel * moneyTitleLab;//付款金额
@property (nonatomic, strong)UILabel * yuanLab;//￥
@property (nonatomic, strong)UIButton * payBtn;//按钮
@property (nonatomic, strong)UIView * lineView;
@end

@implementation PayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"付款";
    
    __weak typeof (self)weak = self;
    [self.view addSubview:self.logoImg];
    [self.view addSubview:self.payeeTitleLab];
    [self.view addSubview:self.moneyTitleLab];
    [self.view addSubview:self.yuanLab];
    [self.view addSubview:self.payBtn];
    [self.view addSubview:self.lineView];
    [self.logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(70/WIDTH_5S_SCALE);
        make.centerX.mas_equalTo(weak.view.mas_centerX);
        make.top.mas_equalTo(28/WIDTH_5S_SCALE);
    }];
    [self.payeeTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weak.logoImg.mas_bottom).offset(10/WIDTH_5S_SCALE);
        make.centerX.mas_equalTo(weak.view.mas_centerX);
        make.height.mas_equalTo(20/WIDTH_5S_SCALE);
        make.left.mas_equalTo(5/WIDTH_5S_SCALE);
        make.right.mas_equalTo(-5/WIDTH_5S_SCALE);
    }];
    [self.moneyTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weak.payeeTitleLab.mas_bottom).offset(19/WIDTH_5S_SCALE);
        make.left.mas_equalTo(5/WIDTH_5S_SCALE);
        make.height.mas_equalTo(20/WIDTH_5S_SCALE);
    }];
    [self.yuanLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weak.moneyTitleLab.mas_bottom).offset(19/WIDTH_5S_SCALE);
        make.left.equalTo(weak.moneyTitleLab.mas_left);
        make.height.mas_equalTo(25/WIDTH_5S_SCALE);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weak.yuanLab.mas_bottom).offset(15/WIDTH_5S_SCALE);
        make.left.equalTo(weak.view.mas_left).offset(13/WIDTH_5S_SCALE);
        make.right.equalTo(weak.view.mas_right).offset(-13/WIDTH_5S_SCALE);
        make.height.mas_equalTo(1/WIDTH_5S_SCALE);
    }];
    [self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weak.lineView.mas_bottom).offset(60/WIDTH_5S_SCALE);
        make.centerX.equalTo(weak.view.mas_centerX);
        make.width.mas_equalTo(223/WIDTH_5S_SCALE);
        make.height.mas_equalTo(26/WIDTH_5S_SCALE);
    }];
}

#pragma mark - init
- (UIImageView *)logoImg{
    if (!_logoImg) {
        _logoImg = [[UIImageView alloc] init];
        _logoImg.layer.cornerRadius = 8;
        _logoImg.layer.masksToBounds = YES;
        _logoImg.image = [UIImage imageNamed:@"kuaijihua"];
        _logoImg.layer.borderColor = getColor(@"b5b5b5").CGColor;
        _logoImg.layer.borderWidth = 1;
    }return _logoImg;
}

- (UILabel *)payeeTitleLab{
    if (!_payeeTitleLab) {
        _payeeTitleLab = [[UILabel alloc] init];
        _payeeTitleLab.font = DEF_FontSize_14;
        _payeeTitleLab.textColor = [UIColor blackColor];
        _payeeTitleLab.textAlignment = NSTextAlignmentLeft;
        _payeeTitleLab.text = @"收款方：收款平台";
        _payeeTitleLab.textAlignment = NSTextAlignmentCenter;
    }return _payeeTitleLab;
}

- (UILabel *)moneyTitleLab{
    if (!_moneyTitleLab) {
        _moneyTitleLab = [[UILabel alloc] init];
        _moneyTitleLab.font = DEF_FontSize_14;
        _moneyTitleLab.textColor = [UIColor blackColor];
        _moneyTitleLab.textAlignment = NSTextAlignmentLeft;
        _moneyTitleLab.text = @"付款金额";
    }return _moneyTitleLab;
}

- (UILabel *)yuanLab{
    if (!_yuanLab) {
        _yuanLab = [[UILabel alloc] init];
        _yuanLab.font = DEF_FontSize_18;
        _yuanLab.textColor = [UIColor blackColor];
        _yuanLab.textAlignment = NSTextAlignmentLeft;
        _yuanLab.text = @"￥";
    }return _yuanLab;
}

- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = getColor(@"eeeeee");
    }return _lineView;
}

- (UIButton *)payBtn{
    if (!_payBtn) {
        _payBtn = [[UIButton alloc] init];
        _payBtn.titleLabel.font = DEF_FontSize_14;
        [_payBtn setTitle:@"付款" forState:UIControlStateNormal];
        [_payBtn setBackgroundColor:getColor(mainColor)];
        [_payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _payBtn.layer.cornerRadius = 4;
        _payBtn.layer.masksToBounds = YES;
    }
    return _payBtn;
}
@end
